import React, {FC, useContext} from 'react';
import "./JournalGuide.less";
import {JournalDetailContext} from "@/pages/JournalPage/JournalDetail/commons/JournalDetailContext";
import {Empty} from "antd";
import {HxConfigContext} from "@/layouts/HxConfigContext";
import {correspVal} from "@/utils/biz";

interface JournalGuideProps {
}

const JournalGuide: FC<JournalGuideProps> = (props) => {
  const {journal} = useContext(JournalDetailContext)
  const {isZhCN} = useContext(HxConfigContext)
  const authorGuidelinesContent = correspVal(isZhCN, journal?.authorGuidelinesContentCn, journal?.authorGuidelinesContentEn)
  return (
    <div className={"journal-guide-container"}>
      {
        !!authorGuidelinesContent ? (
          <div dangerouslySetInnerHTML={{__html: authorGuidelinesContent || ""}}/>
        ) : (
          <Empty/>
        )
      }
    </div>
  );
};

export default JournalGuide;
